package cn.wx.scholar.core.service;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.wx.scholar.core.entity.ScholarCindex;
import cn.wx.common.persistence.base.BaseService;
import cn.wx.scholar.core.mapper.ScholarCindexMapper;
import cn.wx.common.persistence.exception.MyException;
import cn.wx.common.persistence.web.ResponseCode;


/**
 * <p>
 *  服务类
 * </p>
 *
 * @author  
 * @since 2018-11-26
 */
@Service
@Transactional
public class ScholarCindexService extends BaseService<ScholarCindex, ScholarCindexMapper> {

	/**
	 * 新增
	 * @param scholarCindex
	 * @return
	 * @throws MyException 
	 */
	 public boolean create(ScholarCindex scholarCindex) throws MyException{
	 	return insert(scholarCindex);
	 }
	 
	 /**
	 * 修改
	 * @param scholarCindex
	 * @return
	 * @throws MyException 
	 */
	public boolean modify(ScholarCindex scholarCindex) throws MyException{
		// PID 不能为空
		if (scholarCindex.getpId() == null) {
			throw new MyException(ResponseCode.PARAMETER_REQUIRED);
		}
		return update(scholarCindex);
	}
	
}
